<!DOCTYPE html>
<html>
    <head>
		<meta charset="utf-8"/>
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    	<title>选择商城</title>
    	<meta name="keywords" content="商品 管理员" />
    	<meta name="description" content="新增商品" />
		<meta name = "format-detection" content = "telephone=no">
    	<link rel="stylesheet" href="" type="text/css" />
		<link rel="shortcut icon" href="favicon.ico" /> 
			<?php
					session_start();
			 error_reporting(0);
			require('inc/func.php');
			require('inc/mysql.php');
			if($_GET['out']==true){
				session_destroy();
				redirect('','redirect','login/index.php');
				exit();
			}
			if(empty($_SESSION['loginUserName'])){redirect('','redirect','login/index.php');}
			$db->query('select * from adminUser where username=\''.$_SESSION['loginUserName'].'\' and password=\''.$_SESSION['loginPassword'].'\' limit 1');
				if($db->num_rows()<0){redirect('非法访问请登录！','redirect','login/index.php');exit();}
		    $adminUser=$db->query_first('select * from adminUser where id=1 limit 1');
		    $adminUsername=$adminUser['username'];
		?>
		<style type="text/css">
			.formDiv .txtInput {width:55%;font-size:16px;height:20px;padding:10px 10px;border:1px solid #e4e4e4;}
			.submitBtn{display:block;width:50%;height:40px;line-height:40px;border-radius:3px;margin:0 auto;background:#189ad8;color:#fff;font-size:16px;cursor:pointer;}
			.formDiv .add{font-size:14px;}

				.file {
					font-size:14px;
					color:#189ad8;
				}
				.file input {
					position: absolute;
					top:15px;right:-35px;
					opacity: 0;
				}
				.file:hover {
					background: #AADFFD;
					border-color: #78C3F3;
					color: #004974;
					text-decoration: none;
				}
			#feedback img,#feedback2 img,#feedback3 img{
				border: 1px solid silver;
				border-radius:3px;
				padding: 3px; 
				width: 80px;height:80px;
			}
			#feedback,#feedback2,#feedback3{position:relative;margin-top:15px;text-align:center;background:#fff;}
			#feedback .imgClose,#feedback2 .imgClose,#feedback3 .imgClose{width:20px;height:20px;position:absolute;right:-15px;top:-10px;cursor:pointer;padding:0px;border:0px;border-radius:0px;}
			#feedback .appendP,#feedback2 .appendP{width:80px;height:65px;position:relative;margin:auto;margin-top:5px;margin-bottom:20px;}
			#feedback3 .appendP{width:80px;height:65px;position:relative;margin-top:20px;margin-bottom:20px;float:left;margin-left:20px;}
			.houseAdmin .right{width:100%;}
			.houseAdmin .right .top{height:55px;}
			.houseAdmin .right .top .caidan{margin-top:10px;float:left;width:32px;height:32px;margin-left:20px;cursor:pointer;}
			.houseAdmin .right .top .input{border:0px;width:160px;float:left;height:30px;}
			.houseAdmin .right .top .touxiang{width:32px;height:32px;float:right;margin-top:10px;margin-right:10px;}
			.houseAdmin .right .top .touxiang img{max-width:100%;}
			.houseAdmin .right .top .xiala{width:12px;height:12px;float:right;margin-right:10px;margin-top:25px;cursor:pointer;position:relative;}
			.houseAdmin .right .top .xiala .xialaContent{width:110px;text-align:right;border:1px solid #ccc;position:absolute;top:-25px;right:-10px;padding-top:55px;display:none;padding-bottom:1px;}
			.houseAdmin .right .top .xiala .xialaContent a{font-size:12px;display:inline-block;width:100%;height:25px;line-height:25px;background:#3bbfb4;color:#fff;text-decoration:none;text-align:center;border-bottom:1px solid #fff;}
			.houseAdmin .right .top .xiala img{max-width:100%;}
			.houseAdmin .right .top .text{float:right;display:inline-block;margin-top:25px;margin-right:10px;}
			.store{text-align:center;}
			.store a{padding:4px 10px;background:skyblue;color:#fff;border-radius:4px;text-decoration:none;margin-left:20px;}
		</style>
    </head>
    <body>
		<div class="houseAdmin" id="houseAdmin">
			<div class="right">
				<div class="top">
					<div class="caidan"><a href=""><img src="inc/images/caidan.png" alt=""/></a></div>
					
					<div class="xiala">
						<img src="inc/images/xiala.png" alt=""/>
						<div class="xialaContent">
							<a href="?out=true">loginOut</a>
							<?php if($_SESSION['loginUserName']==$adminUsername){?>
							<a href="addAdmin.php">添加管理员</a>
							<a href="editAdmin.php">修改账号和密码</a>
							<?php }?>
						</div>
					</div>
					<span class="text"><?php echo $_SESSION['loginUserName'];?></span>
					<div class="touxiang">
						<img src="inc/images/touxiang.png" alt=""/>
					</div>
				</div>	
			</div>
		</div>
		<p class="mb15">选择商城:</p>
		<div class="store">		
		<?php 
			$db->query('select * from hjmall_store');
			while($row=$db->next_record()){
		?>
			<a href="index.php?store_id=<?php echo $db->f('id');?>"><?php echo $db->f('name');?></a>

		<?php }?>
		</div>
		<script type="text/javascript" src="inc/jquery-1.7.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$('#houseAdmin').find('.xiala').click(function(){
					$(this).find('.xialaContent').css('display','block');
				})
				
			});
		</script>
	</body>
</html>